package com.zzyk.main.mapper;

import com.zzyk.main.model.pojo.Area;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AreaMapper {
    /**
     * delete by primary key
     *
     * @param areaid primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer areaid);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(Area record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(Area record);

    /**
     * select by primary key
     *
     * @param areaid primary key
     * @return object by primary key
     */
    Area selectByPrimaryKey(Integer areaid);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(Area record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(Area record);

    List<Area> selectAllByArealevel(@Param("arealevel") Integer arealevel);

    Area selectAllByAreaname(@Param("areaname") String areaname);

    List<Area> selectAllByParentid(@Param("parentid") Integer parentid);


    Area selectByAreaNameAndParentId(@Param("city") String city, @Param("areaid") Integer areaid);
}
